package me.zhengjie.modules.fund.service.dto;

import lombok.Builder;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.List;

/**
 * 年薪计算器结果
 */
@Getter
@Setter
public class RespAnnualSalaryCalculate {

    /**
     * 税前总收入
     */
    private double totalSalaryBeforeTax;

    /**
     * 共交纳个税
     */
    private double totalPersonalTax;

    /**
     * 共交纳社保
     */
    private double totalSocialSecurity;

    /**
     * 税后总收入
     */
    private double totalSalaryAfterTax;

    /**
     * 月薪资明细
     */
    private List<MonthSalaryDetail> monthDetails;

    /**
     * 月薪资
     */
    @Getter
    @Setter
    @Builder
    public static class MonthSalaryDetail implements Serializable {
        private static final long serialVersionUID = 6154787774974403723L;
        /**
         * 月份
         */
        private int month;

        /**
         * 税前薪资
         */
        private Double salaryBeforeTax;

        /**
         * 税后工资
         */
        private Double salaryAfterTax;

        /**
         * 社保交纳情况
         */
        private SocialSecurity socialSecurity;

        /**
         * 个税信息
         */
        private PersonalTax personalTax;
    }


    /**
     * 社保交纳情况
     */
    @Getter
    @Setter
    public static class SocialSecurity implements Serializable {
        private static final long serialVersionUID = 4410665904064601249L;
        /**
         * 个人交纳总金额
         */
        private Double totalAmountOfPersonal;

        /**
         * 企业交纳总金额
         */
        private Double totalAmountOfCompany;

        /**
         * 社保交纳项明细
         */
        private List<SocialSecurityItem> items;
    }

    /**
     * 社保项
     */
    @Getter
    @Setter
    @Builder
    public static class SocialSecurityItem implements Serializable {
        private static final long serialVersionUID = -2226421049432171983L;
        /**
         * 社保类型
         */
        private SocialSecurityType type;

        /**
         * 基数
         */
        private double baseAmount;

        /**
         * 公司上交比例
         */
        private double rateOfCompany;

        /**
         * 公司扣除金额
         */
        private double amountOfCompany;

        /**
         * 个人上交比例
         */
        private double rateOfPersonal;

        /**
         * 个人上交固定金额 医保为基数*个人比例+固定金额3元
         */
        private double fixAmountOfPersonal;

        /**
         * 个人扣除金额
         */
        private double amountOfPersonal;
    }

    /**
     * 个税
     */
    @Getter
    @Setter
    @Builder
    public static class PersonalTax implements Serializable {

        private static final long serialVersionUID = 8907525326781853383L;
        /**
         * 月份
         */
        private int month;

        /**
         * 当月薪资
         */
        private double salaryBeforeTax;

        /**
         * 累计收入
         */
        private double totalSalaryBeforeTaxOfYear;

        /**
         * 累计社保公积金扣除
         */
        private double totalSocialDeductionAmountOfYear;

        /**
         * 累计专项附加扣除
         */
        private double totalSpecialAddonDeductionAmountOfYear;

        /**
         * 累计减免费用(起征点*月数)
         */
        private double totalDeductionAmountOfYear;

        /**
         * 应税收入
         */
        private double shouldTaxSalary;

        /**
         * 累计应纳税额
         */
        private double totalShouldTaxAmountOfYear;

        /**
         * 累计已纳税额(不含当月)
         */
        private double totalHasTaxAmountOfYear;

        /**
         * 个人所得税(当月)
         */
        private double taxAmount;

        /**
         * 税率
         */
        private double taxRate;
    }
}
